<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>
        <p:dialog id="ExpedienteEditDlg" widgetVar="ExpedienteEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{myBundle.EditExpedienteTitle}" closeOnEscape="true">

            <h:form id="ExpedienteEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" columnClasses="column" rendered="#{expedienteController.selected != null}">


                        <h:outputLabel value="#{myBundle.EditExpedienteLabel_id}" for="id" />
                        <h:outputText id="id" value="#{expedienteController.selected.id}" />

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_partidoId}" for="partidoId" />
                        <p:inputText id="partidoId" value="#{expedienteController.selected.partido}" title="#{myBundle.EditExpedienteTitle_partidoId}" required="true" requiredMessage="#{myBundle.EditExpedienteRequiredMessage_partidoId}"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_alcance}" for="alcance" />
                        <p:inputText id="alcance" value="#{expedienteController.selected.alcance}" title="#{myBundle.EditExpedienteTitle_alcance}" required="true" requiredMessage="#{myBundle.EditExpedienteRequiredMessage_alcance}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_cuerpo}" for="cuerpo" />
                        <p:inputText id="cuerpo" value="#{expedienteController.selected.cuerpo}" title="#{myBundle.EditExpedienteTitle_cuerpo}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_extracto}" for="extracto" />
                        <p:inputText id="extracto" value="#{expedienteController.selected.extracto}" title="#{myBundle.EditExpedienteTitle_extracto}" size="40" maxlength="40"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_fechaInicio}" for="fechaInicio" />
                        <p:calendar id="fechaInicio" pattern="MM/dd/yyyy" value="#{expedienteController.selected.fechaInicio}" title="#{myBundle.EditExpedienteTitle_fechaInicio}"  showOn="button"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_tipoExpediente}" for="tipoExpediente" />
                        <p:inputText id="tipoExpediente" value="#{expedienteController.selected.tipoExpediente}" title="#{myBundle.EditExpedienteTitle_tipoExpediente}"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_numero}" for="numero" />
                        <p:inputText id="numero" value="#{expedienteController.selected.numero}" title="#{myBundle.EditExpedienteTitle_numero}" size="20" maxlength="20"/>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_tipoExpedienteId}" for="tipoExpedienteId" />
                        <p:selectOneMenu id="tipoExpedienteId" value="#{expedienteController.selected.tipoExpedienteId}"  converter="tipoExpedienteConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{tipoExpedienteController.items}"
                                           var="tipoExpedienteIdItem"
                                           itemValue="#{tipoExpedienteIdItem}"
                                           itemLabel="#{tipoExpedienteIdItem.id.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.EditExpedienteLabel_barrioId}" for="barrioId" />
                        <p:selectOneMenu id="barrioId" value="#{expedienteController.selected.barrioId}"  converter="barrioConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{barrioController.items}"
                                           var="barrioIdItem"
                                           itemValue="#{barrioIdItem}"
                                           itemLabel="#{barrioIdItem.id.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{expedienteController.save}" value="#{myBundle.Save}" update="display,:ExpedienteListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,ExpedienteEditDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="ExpedienteEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
